<div id="content">

    <div id="content-header">

        <div id="breadcrumb"><a href="<?php echo site_url('Login/login') ?>" title="Go to Home" class="tip-bottom"><i
                class="icon-home"></i> 主页</a> <a href="#" class="current">客服工作台</a></div>

        <h1>玩家退卡</h1>

    </div>

    <div class="container-fluid">

        <hr>

        <div class="row-fluid">
            <div class="span8">
                <!--修改数据表单/edit news form-->
                <div class="widget-box">
                    <div class="widget-title"><span class="icon"> <i class="icon-align-justify"></i> </span>
                        <h5>添加退卡信息</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <form action="<?php echo site_url('customService/doCardAction/user/out') ?>" method="post" class="form-horizontal">
                            <div class="control-group">
                                <label class="control-label">游戏类目:</label>
                                <div class="controls">
                                    <select name="gid" class="span6">
                                        <option value="0" selected='selected'>来来乐斗牛
                                        </option>
                                        <option value="1">广东转转麻将
                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">玩家ID:</label>

                                <div class="controls">
                                    <input type="text" name='uid' class="span6" placeholder="请输入ID" required="required">
                                    <button type="button" class="btn btn-success" onclick="getUserInfo()">查询</button>
                                </div>
                            </div>
                            <table class="table table-bordered static-table" id="cardTable" style="display: none">
                                <thead>
                                <tr>
                                    <td>玩家ID</td>
                                    <td>名字</td>
                                </tr>
                                <tr>
                                    <td>玩家账号</td>
                                    <td>名字</td>
                                </tr>
                                <tr>
                                    <td>房卡余额</td>
                                    <td>名字</td>
                                </tr>
                                </thead>
                            </table>
                            <div class="alert alert-error alert-block" id="cardTable1" style="display: none"><a class="close" data-dismiss="alert"
                                                                                                                href="#">×</a>
                                <b style="text-align:center">没有查询到信息</b>
                            </div>
                            <div class="control-group">
                                <label class="control-label">房卡数量:</label>

                                <div class="controls">
                                    <input type="text" name='cardnumber' class="span6" placeholder="请输入房卡数量" required="required">
                                </div>
                            </div>

                            <div class="form-actions">
                                <button type="submit" class="btn btn-success">退卡</button>
                            </div>
                        </form>
                    </div>
                </div>

                <!--修改数据表单/edit news form-->
            </div>
        </div>

    </div>

</div>
<script>
    function getUserInfo() {
        var gid = $("select[name='gid']").val();
        var uid = $("input[name='uid']").val();
        var url = window.location.origin + '/admin/index.php/customService/searchInfo';
        $.post(url, {'gid': gid, 'uid': uid, 'type': 1},
            function (data) {
                if (data.status == 0) {
                    $("#cardTable1").removeAttr("style")
                    $("#cardTable").css('display','none')
                } else {
                    $("#cardTable").removeAttr("style")
                    $("#cardTable1").css('display','none')
                    $("#cardTable td:eq(1)").html(data.UserID)
                    $("#cardTable td:eq(3)").html(data.Accounts)
                    $("#cardTable td:eq(5)").html(data.RoomCard)
                }
            }, 'json');
    }
</script>